<?php

class M_giaodien extends CI_Model {

// Constructor model
    function __construct() {
        parent::__construct();

        // Load database
        $this->load->database();
    }

    function getValue($ID_element) {
        $query = $this->db->get_where('GiaoDien', array('ID_element' => $ID_element));
        foreach ($query->result() as $row) {
            $item = $row->Value_element;
        }
        return $item;
    }

    function updateImage($ID_element, $data) {
        if ($this->db->where('ID_element', $ID_element) && $this->db->update('giaodien', $data))
            return true;
        else
            return FALSE;
    }

}
